/*
 * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
 */
package com.pateo.mytestcase;

/**
 * Created by sh04799 on 2017/8/30.
 */

import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiObjectNotFoundException;
import android.support.test.uiautomator.UiSelector;

import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(AndroidJUnit4.class)
public class TestOne {
    private UiDevice mDevice;

    @Test
    public void demo() throws UiObjectNotFoundException {
        mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
        mDevice.pressHome();
        mDevice.pressHome();
        UiObject x = mDevice.findObject(new UiSelector().text("浏览器"));
        x.click();

    }
}